/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.sapra.echo;

import nextapp.echo2.app.Color;
import nextapp.echo2.app.Component;
import nextapp.echo2.app.Extent;
import nextapp.echo2.app.Font;
import nextapp.echo2.app.Label;
import nextapp.echo2.app.Table;
import nextapp.echo2.app.layout.TableLayoutData;
import nextapp.echo2.app.table.DefaultTableCellRenderer;
import nextapp.echo2.app.table.TableCellRenderer;

/**
 *
 * @author luiz
 */
class TableCell extends DefaultTableCellRenderer implements TableCellRenderer{

@Override
    public Component getTableCellRendererComponent(Table table,Object value,int column,int row){

        Label label=new Label(value.toString());
        TableLayoutData tld=new TableLayoutData();
        if(row%2==0)
            tld.setBackground(Color.WHITE);//175 238 238
        else
            tld.setBackground(new Color(175,238,238));//175 238 238
        label.setForeground(Color.BLACK);
        label.setLayoutData(tld);
        label.setFont(new Font(Font.ARIAL, 1, new Extent(10)));
        return label;
    }

}

